package com.wenjunwu.blog.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.wenjunwu.blog.common.BaseDao;
import com.wenjunwu.blog.dao.BlogContentDao;
import com.wenjunwu.blog.entity.BlogContent;

@Repository
public class BlogContentDaoImpl extends BaseDao<BlogContent> implements BlogContentDao {

	@Override
	public int deleteByPrimaryKey(Long id) {
		return 0;
	}

	@Override
	public int insert(BlogContent record) {
		return sqlSession.insert(DEFAULTNAMESPACE.concat("insert"), record);
	}

	@Override
	public BlogContent selectByPrimaryKey(Long id) {
		return sqlSession.selectOne(DEFAULTNAMESPACE.concat("selectByPrimaryKey"), id);
	}

	@Override
	public List<BlogContent> selectAll() {
		return sqlSession.selectList(DEFAULTNAMESPACE.concat("selectAll"), null);
	}

	@Override
	public List<BlogContent> selectSummarys(Map<String, Object> params) {
		return sqlSession.selectList(DEFAULTNAMESPACE.concat("selectSummarys"), params);
	}

	@Override
	public int updateByPrimaryKey(BlogContent record) {
		return sqlSession.update(DEFAULTNAMESPACE.concat("updateByPrimaryKey"), record);
	}

	@Override
	public List<BlogContent> selectByParams(Map<String, Object> params) {
		return sqlSession.selectList(DEFAULTNAMESPACE.concat("selectByParams"), params);
	}

}
